﻿<UserControl x:Class="MontagsmalerApp.SpielerverwaltungPflege"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
						 xmlns:local="clr-namespace:MontagsmalerApp"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300" PreviewMouseLeftButtonDown="UserControl_PreviewMouseLeftButtonDown" PreviewMouseMove="UserControl_PreviewMouseMove" MinWidth="300" MinHeight="300">
		<Grid Name="grid1">
			<Grid.RowDefinitions>
				<RowDefinition Height="67*" />
				<RowDefinition Height="233*" />
			</Grid.RowDefinitions>
			<Grid.ColumnDefinitions>
				<ColumnDefinition />
				<ColumnDefinition />
			</Grid.ColumnDefinitions>
			<!-- http://stackoverflow.com/questions/1912481/wpf-treeview-hierarchicaldatatemplate-binding-to-object-with-multiple-child-co -->
			<TreeView Grid.Row="1" Name="treeTeams" ItemsSource="{Binding}" Drop="treeTeams_Drop" AllowDrop="True">
			<TreeView.ItemContainerStyle>
				<Style>
					<Setter Property="TreeViewItem.IsExpanded" Value="True"></Setter>
				</Style>
			</TreeView.ItemContainerStyle>
				<TreeView.Resources>
					<HierarchicalDataTemplate DataType="{x:Type local:Spielerteam}" ItemsSource="{Binding Einzelspieler}">
						<TextBlock Text="{Binding Path=NamePunkte}"></TextBlock>
					</HierarchicalDataTemplate>
					<DataTemplate DataType="{x:Type local:Einzelspieler}">
						<TextBlock Text="{Binding Path=NamePunkte}"></TextBlock>
					</DataTemplate>
				</TreeView.Resources>
			</TreeView>
			<TreeView Grid.Column="1" Grid.Row="1"  Name="treeSpieler" ItemsSource="{Binding}" AllowDrop="False">
			</TreeView>
			<Button Content="Neu" Grid.Column="1" Height="23" HorizontalAlignment="Left" Margin="108,35,0,0" Name="btnNeuerSpieler" VerticalAlignment="Top" Width="29" Click="btnNeuerSpieler_Click" />
			<Button Content="Neu" Height="23" HorizontalAlignment="Left" Margin="6,34,0,0" Name="btnNeuesTeam" VerticalAlignment="Top" Width="33" Click="btnNeuesTeam_Click" />
			<Button Content="Del" Height="23" HorizontalAlignment="Left" Margin="45,34,0,0" Name="btnLoescheTeam" VerticalAlignment="Top" Width="33" Click="btnLoescheTeam_Click" IsEnabled="True" />
			<Button Content="Del" Height="23" HorizontalAlignment="Left" Margin="73,35,0,0" Name="btnLoescheSpieler" VerticalAlignment="Top" Width="29" Grid.Column="1" IsEnabled="True" Click="btnLoescheSpieler_Click" />
			<TextBox Height="23" HorizontalAlignment="Left" Margin="84,35,0,0" Name="txtTeamName" VerticalAlignment="Top" Width="54" />
			<TextBox Height="23" HorizontalAlignment="Left" Margin="13,35,0,0" Name="txtSpielerName" VerticalAlignment="Top" Width="54" Grid.Column="1" />
			<Label Content="Alle Teams" Height="28" HorizontalAlignment="Left" Margin="6,6,0,0" Name="lblTeams" VerticalAlignment="Top" />
			<Label Content="Alle Spieler" Height="28" HorizontalAlignment="Left" Margin="13,6,0,0" Name="lblSpieler" VerticalAlignment="Top" Grid.Column="1" />
		</Grid>
</UserControl>
